1. Field of the Invention
The present invention relates to a technology for moving image data from a volatile memory to a nonvolatile memory.
2. Description of the Related Art
Printers that can print a longer-than-standard image are known in the art. Such a printer first writes image data to be printed into a volatile memory such as a random access memory (RAM), and then moves the image data page by page from the volatile memory to a nonvolatile memory such as a hard disk drive (HDD) thereby preventing occurrence of a memory full error in the volatile memory. However, if the image data is moved from the volatile memory to the HDD at the end of each page, when the image data of a page is too large, the volatile memory becomes full in the middle of the writing of the image data corresponding to the page. To solve the problem, Japanese Patent Application Laid-open No. 2006-44157 discloses a technology to efficiently prevent the memory full error by separating the volatile memory into several memory areas each having a certain amount, and moving the image data from the volatile memory to the nonvolatile memory in consideration of usage of the volatile memory. There is disclosed another technology to print the image with no break and no memory full error by moving the image data from the volatile memory to the nonvolatile memory, toggling between the memory areas of the volatile memory.
The data moving technique is used in a process of scanning the longer-than-standard image by a scanner engine. More particularly, the image data obtained by the scanner engine is stored in the volatile memory by using a function of an application specific integrated circuit (ASIC) and a video input device. When a predetermined amount of the image data is stored in the volatile memory, an interrupt event called “chain interrupt” occurs. The chain interrupt acts as a trigger to move the image data from the volatile memory to the nonvolatile memory.
However, the above process is effective only when the image data is monochrome. If the image data is color image data, three video input devices for red (R), green (G), and blue (B) or four video input devices for yellow (Y), magenta (M), cyan (C), and black (K) are required. Although a scanning speed of the video input devices is high enough in scanning of the monochrome image, the scanning speed generally drops to a not-enough level in scanning of the color image where the video input devices simultaneously receive inputs of the different colors. Taking those conditions into consideration, a technology to implement a high-enough scanning performance by using a peripheral component interconnect (PCI) direct access, an interrupt to the PCI direct access, and an engine descriptor as a hardware function has been disclosed.
It is noted that in the process in which the scanner engine writes the obtained image data into the volatile memory by using the PCI direct access and the interrupt to the PCI direct access, the scanner engine uses a writing start address and a data size that are specified by a controller. The controller controls access to the volatile memory. In a case of scanning the longer-than-standard image, because the controller specifies the data size before the total data size is measured, the controller specifies a reference size as the data size. If the total data size is larger than the reference size, the controller corrects the writing start address and the data size, which causes an additional load on the scanner engine. On the other hand, the scanner engine is required to scan the longer-than-standard image with no break. In those conditions, the additional load caused by the correction of the writing start address and the data size by the controller may temporarily stop the scanning operation of the scanner engine. Moreover, if the size of the image data is larger than a physical memory capacity of the volatile memory, the scanner engine has to stop the scanning operation temporarily. The toggling between the memory areas of the volatile memory by using the engine descriptor makes the writing of the longer-than-standard image data with no break possible, even when the physical memory capacity of the volatile memory is limited.
The scanner engine acts as a master of a direct memory access (DMA) transfer for writing of the image data to the volatile memory. Therefore, the controller cannot directly obtain logs about the writing operation. It means that, there is possibility that the controller cannot move the image data from the volatile memory to the HDD until receiving a notice of completion of the writing from the scanner engine. In other words, when the longer-than-standard image data is scanned, there is possibility that the controller cannot properly control timing to move the image data from the volatile memory to the HDD. Moreover, even if the timing is correct, there is possibility that improper image data, such as old image data or already-written image data, is moved to the HDD.